package object.day05;

import java.io.*;

/**
 * 改正下面程序的错误
 * <p>
 * 程序实现需求:使用缓冲流完成文件的复制操作
 *
 * @author Xiloer
 */
public class Test02 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("test.txt");
       /* InputStreamReader in = new InputStreamReader(fis);
        BufferedReader bis = new BufferedReader(in);*/
       BufferedInputStream bos = new BufferedInputStream(fis);
        FileOutputStream fos = new FileOutputStream("test_cp.txt");
        /*OutputStreamWriter ow = new OutputStreamWriter(fos);
        BufferedWriter bos = new BufferedWriter(ow);*/
        BufferedOutputStream bis  = new BufferedOutputStream(fos);
        int d = 0;
        while ((d = bos.read()) != -1) {
           bis.write(d);
        }
        System.out.println("复制完毕!");
        bos.close();
        bis.close();
    }
}
